package cn.mes.module.mes.enums;

import lombok.Getter;

/**
 * Title: <br>
 * Description: <br>
 * Copyright: Copyright (c) 2024<br>
 * Company: 四川瀚海精密制造有限公司<br>
 *
 * @author youchuang
 * @version 1.0
 * @date 2024-08-29 8:00
 */
@Getter
public enum WorkShopEnum {
    MOLDING_WORK_SHOP("成型", "成型车间"),
    ASSEMBLY_WORK_SHOP("组装", "组装车间"),
    PAINTING_WORK_SHOP("喷漆", "喷漆车间"),
    POLISHING_WORK_SHOP("打磨", "打磨车间");
    private String code;
    private String name;

    WorkShopEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static WorkShopEnum getEnumByCode(String code) {
        for (WorkShopEnum e : WorkShopEnum.values()) {
            if (e.code.equals(code)) {
                return e;
            }
        }
        throw new IllegalArgumentException("No enum constant with code " + code);
    }
}
